import React from 'react';
import {connect} from 'dva'
import moment from 'moment'

import { Tabs } from 'antd-mobile';
import Title from 'components/Title'
import UnderWater from './UnderWater'
import SurfaceWater from './SurfaceWater'

const format = 'YYYY-MM-DD'
const nowTimeStamp = Date.now();
const now = new Date(nowTimeStamp);
const time = moment(now).format(format)

class RealTime extends React.Component {
    List = [
      { title: '地下水厂' },
      { title: '地表水厂' }
    ];

  constructor(props) {
    super(props);

    this.state = {
      time
    }
  }

  render() {
    const { List } = this;

    return (<Title title={'水厂实时数据'}>
          <Tabs tabs={List} renderTab={tab => <span>{tab.title}</span>}>
            <UnderWater
              defaultValue = {time}/>
            <SurfaceWater />
          </Tabs>
        </Title>
    )
  }
}

export default RealTime;
